{include file="common/mate"}
<body>
	<!-- 头部 -->
	{include file="common/top"}

	<!-- /头部 -->
	
	<div class="main-container container-fluid">
		<div class="page-container">
			            <!-- Page Sidebar -->
            <div class="page-sidebar" id="sidebar">
                <!-- Page Sidebar Header-->
                <div class="sidebar-header-wrapper">
                    <input class="searchinput" type="text">
                    <i class="searchicon fa fa-search"></i>
                    <div class="searchhelper">Search Reports, Charts, Emails or Notifications</div>
                </div>
            </div>
                <!-- /Page Sidebar Header -->
                <!-- Sidebar Menu -->
                    {include file="common/left"}
                <!-- /Sidebar Menu -->
            </div>

            <!-- /Page Sidebar -->
            <!-- Page Content -->
            <div class="page-content">
                <!-- Page Breadcrumb -->
                <div class="page-breadcrumbs">
                    <ul class="breadcrumb">
                                        <li>
                        <a href="#">系统</a>
                    </li>
                                        <li class="active">图片管理</li>
                                        </ul>
                </div>
                <!-- /Page Breadcrumb -->

                <!-- Page Body -->
             <div class="page-body">
                    

<button type="button" tooltip="添加文章" class="btn btn-sm btn-azure btn-addon" onClick="javascript:window.location.href = '{:url('article/add')}'"> <i class="fa fa-plus"></i> Add

</button>
<div class="row">
    <div class="col-lg-12 col-sm-12 col-xs-12">
        <div class="widget">
            <div class="widget-body">
                <div class="flip-scroll">
                    <table class="table table-bordered table-hover">
                        <thead class="">
                            <tr>

                                <th class="text-center" >缩略图</th>
                                <th class="text-center"  width="15%">操作</th>
                            </tr>
                        </thead>
                        <tbody>
                                {volist name="imgRes" id="img"}
                                 <tr>

                                   <td align="center"><img src="{$img}" alt="" width="70"></td>
                                    <td align="center">
                                        <a href="#" onClick="return delimg(this);" id="{$img}" class="btn btn-danger btn-sm shiny">
                                            <i class="fa fa-trash-o"></i> 删除
                                        </a>
                                    </td>
                                 </tr>
                                 {/volist}

                                                    </tbody>
                    </table>
                    <script>
                        function delimg(o){
                            if (!confirm('确定删除这张图片么')){
                            return false;
                        }
                            var url="{:url('delimg')}";
                            var imgsrc=$(o).attr('id');

                            $.ajax({
                                url : url,
                                type : "post",
                                dataType : "json",
                                data :{imgsrc:imgsrc},
                                success : function(data) {
                                    if(data==1){
                                        $(o).parent().parent().remove();
                                        alert('删除图片成功');
                                    }else if(data==2){
                                        alert('删除图片失败');
                                    }else{
                                        alert('图片不存在');
                                    }

                                }
                            });
                        }
                    </script>
                </div>
                <div style="padding-top:10px;text-align: right">

                <div>
                	                </div>
            </div>
        </div>
    </div>
</div>

                </div>
                <!-- /Page Body -->
            </div>
            <!-- /Page Content -->
		</div>	
	</div>
    {include file="common/js"}
</body></html>